#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
const int N = 1e5 + 10;
int arr[N];
int n;
int main()
{
	int t;
	cin >> t;
	while (t--) {
		cin >> n;
		memset(arr, 0, sizeof(arr));
		for (int i = 1; i <= n; i++) {
			cin >> arr[i];
		}
		int ma = 0;
		for (int i = 1; i < n; i++) {
			int j = i;
			while (j <= n - 1 && arr[j + 1] >= arr[j]) {
				j++;
			}
			ma = max(ma, arr[j] - arr[i]);
			i = j;
		}
		cout << ma << endl;
		int ans = 0;
		for (int i = 1; i < n;i++ ) {
			int j = i;
			while (j <= n - 1 && arr[j] <= arr[j + 1]) {
				j++;
			}
			ans = arr[j] - arr[i];
			if (ans == ma) {
				cout << i << " " << j << " ";
			}
			i = j;
		}
		cout << endl;
	}
	return 0;
}